package cn.zjk.springframework.beans.factory.config;

import cn.zjk.springframework.beans.BeansException;

/**
 * @description: Factory hook that allows for custom modification of new bean instances,
 * e.g. checking for marker interfaces or wrapping them with proxies.
 * @Author zjk
 * @className: BeanPostProcesser
 * @date: 2023/3/27 17:36
 */
public interface BeanPostProcessor {
    /**
     * 在bean初始化之前执行
     * @param bean
     * @param beanName
     * @return
     * @throws BeansException
     */
    Object postProcessBeforeInitialization(Object bean,String beanName)throws BeansException;

    /**
     * 在Bean实例化之后执行
     * @param bean
     * @param beanName
     * @return
     * @throws BeansException
     */
    Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException;
}
